package com.zbkj.admin.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.GsonTypeHandler;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import com.mybatisflex.core.handler.FastjsonTypeHandler;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Map;

/**
 * 订单完成后未释放抵用券流水 实体类。
 *
 * @author mybatis-flex-helper automatic generation
 * @since 1.0
 */
@Accessors(chain = true)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(name = "订单完成后未释放抵用券流水")
@TableName(value = "eb_order_product_voucher_record")
@Table(value = "eb_order_product_voucher_record")
public class EbOrderProductVoucherRecordEntity implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @Schema(description = "主键")
    @Id(keyType = KeyType.Auto)
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 用户id
     */
    @Schema(description = "用户id")
    @Column(value = "uid")
    @TableField(value = "uid")
    private Long uid;

    /**
     * 订单号
     */
    @Schema(description = "订单号")
    @Column(value = "order_no")
    @TableField(value = "order_no")
    private String orderNo;

    /**
     * 商品详情
     */
    @Schema(description = "商品详情")
    @Column(value = "data", typeHandler = FastjsonTypeHandler.class)
    @TableField(value = "data", typeHandler = GsonTypeHandler.class)
    private Map<String, Object> data;

    /**
     * 是否有效
     */
    @Builder.Default
    @Schema(description = "是否有效")
    @Column(value = "is_effective")
    @TableField(value = "is_effective")
    private Integer isEffective = 0;

    /**
     * 创建时间
     */
    @Builder.Default
    @Schema(description = "创建时间")
    @Column(value = "create_time")
    @TableField(value = "create_time")
    private LocalDateTime createTime = LocalDateTime.now();


}
